package com.qd.common.sys.domain.entity.msg;

import com.cdqidi.dict.annotation.FieldBind;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.qd.common.dict.DictConstant;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 发送表
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class MsgReceiveDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "发送ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "发送ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String receiveId;
    /**
     * 消息ID
     */
    @Size(max = 64, message = "消息ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String msgId;
    /**
     * 业务ID
     */
    @Size(max = 64, message = "业务ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String msgSubId;
    /**
     * 手机号码
     */
    @Size(max = 20, message = "手机号码长度不能超过{max}位", groups = DefaultGroup.class)
    private String mobile;
    /**
     * 消息类型
     */
    @Size(max = 50, message = "消息类型长度不能超过{max}位", groups = DefaultGroup.class)
    private String msgType;
    /**
     * 消息事件
     */
    @Size(max = 50, message = "消息事件长度不能超过{max}位", groups = DefaultGroup.class)
    @FieldBind(processName = DictConstant.SYS_MSG_EVENT,targetField = "msgEventDisplay")
    private String msgEvent;
    /**
     * 消息事件显示
     */
    private String msgEventDisplay;
    /**
     * 用户类型
     */
    private Integer fromUserType;
    /**
     * 发送人
     */
    @Size(max = 50, message = "发送人长度不能超过{max}位", groups = DefaultGroup.class)
    private String fromUser;
    /**
     * 接收人
     */
    @Size(max = 50, message = "接收人长度不能超过{max}位", groups = DefaultGroup.class)
    private String toUser;
    /**
     * 发送状态
     */
    @NotNull(message = "发送状态不能为空", groups = DefaultGroup.class)
    @FieldBind(processName = DictConstant.SYS_SEND_STATUS,targetField = "statusDisplay")
    private Integer status;
    /**
     * 发送状态显示
     */
    private String statusDisplay;
    /**
     * 微信用户标识
     */
    @Size(max = 200, message = "微信用户标识长度不能超过{max}位", groups = DefaultGroup.class)
    private String openid;
    /**
     * 发送时间
     */
    @NotNull(message = "发送时间不能为空", groups = DefaultGroup.class)
    private LocalDateTime sendTime;
    /**
     * 写入时间
     */
    private LocalDateTime addTime;

    @Override
    public void freeData() {
        this.receiveId = null;
        this.msgId = null;
        this.msgSubId = null;
        this.mobile = null;
        this.msgType = null;
        this.msgEvent = null;
        this.msgEventDisplay = null;
        this.fromUserType = null;
        this.fromUser = null;
        this.toUser = null;
        this.status = null;
        this.statusDisplay = null;
        this.openid = null;
        this.sendTime = null;
        this.addTime = null;
        super.freeData();
    }
}
